#!/bin/bash
. functions.sh

mkdir -p /tmp/vagrant-cache/wget

echo "--> Begin to download elasticsearch package from: ${DL_SERVER}, using ${ID_RSA_PATH}"
if [ ${DL_SERVER} == "it-deploy.foxitcloud.com" ]; then
        rsync -av --rsh="ssh -p 22 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@10.103.3.151:/opt/www/ops30.sumilux.com/elasticsearch/ /tmp/vagrant-cache/wget/
else
        rsync -av --rsh="ssh -p 333 -oUserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no -i ${ID_RSA_PATH}" smx@${DL_SERVER}:/opt/www/ops30.sumilux.com/elasticsearch/ /tmp/vagrant-cache/wget/
fi
